package com.ds.infrastructure.hyperspace.console.model.response.log;

import com.ds.infrastructure.hyperspace.console.entity.table.TbNodeExecuteLog;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author: yaozhendong
 * @create: 2019-10-28 16:25
 **/
@Data
@NoArgsConstructor
public class LogInfoVO {
    private Long id;

    private Long nodeId;

    private Long taskId;

    private Integer taskType;

    private Integer stepId;

    private String stepName;

    private String requestData;

    private String responseData;

    private Integer executeState;

    private Date gmtModified;

    private Date gmtCreate;

    public static LogInfoVO toVO(TbNodeExecuteLog entity) {
        LogInfoVO logInfoVO = new LogInfoVO();
        logInfoVO.setId(entity.getId());
        logInfoVO.setNodeId(entity.getNodeId());
        logInfoVO.setTaskId(entity.getTaskId());
        logInfoVO.setTaskType(entity.getTaskType());
        logInfoVO.setStepId(entity.getStepId());
        logInfoVO.setStepName(entity.getStepName());
        logInfoVO.setRequestData(entity.getRequestData());
        logInfoVO.setResponseData(entity.getResponseData());
        logInfoVO.setExecuteState(entity.getExecuteState());
        logInfoVO.setGmtModified(entity.getGmtModified());
        logInfoVO.setGmtCreate(entity.getGmtCreate());
        return logInfoVO;
    }
}
